<template>
  <div style="background: #202B61;width: 100%;height: 100%;">

    <div style="top: 1%; width: 99%;height: 92vh;float: left;position: absolute;">

      <div class="box1">
        <el-row style="top: 1vh;width: 90%;float: left;">
          <el-col :span="8" style="float: left;font-size: 14px;">
            <span class="checkbox">设备方案</span>
          </el-col>
          <el-col :span="16" style="float: right;">
            <el-button size="mini" type="primary" @click="creat">新建</el-button>
            <el-button size="mini" type="warning" @click="deletePlan">删除</el-button>
          </el-col>
        </el-row>
        <el-row style="top: 3vh;width: 90%;margin-left: 1vh;">
          <el-table :data="listPlan" :border="true" :stripe="true" :show-header="false" highlight-current-row
            @current-change="currentChange">
            <el-table-column align="center" prop="plan_name" @click="choose()"></el-table-column>
          </el-table>
        </el-row>
      </div>
      <div class="box2">
        <el-row style="top: 1vh;margin-left: 1vh;width: 99%;height: 7vh;float: left;">
          <el-form ref="planForm" :inline="true" :model="planForm" :rules="rules" style="float: left;margin-left: 2vh;">
            <el-form-item label="方案名称" prop="planName">
              <label slot="label" style="color: white;">方案名称</label>
              <el-input v-model="planForm.planName" placeholder="方案名称"></el-input>
            </el-form-item>
            <el-form-item label="优化目标" prop="target">
              <label slot="label" style="color: white;">优化目标</label>
              <el-select v-model="planForm.target" placeholder="优化目标" @change="change">
                <el-option label="经济性最优" value="经济性最优"></el-option>
                <el-option label="环境性最优" value="环境性最优"></el-option>
                <el-option label="能源利用率最优" value="能源利用率最优"></el-option>
                <el-option label="综合最优" value="综合最优"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="智能选型">
              <label slot="label" style="color: white;">智能选型</label>
              <el-switch v-model="planForm.intelligence"></el-switch>
            </el-form-item>
            <el-form-item>
              <el-checkbox class="checkbox" v-model="planForm.jjx" :disabled="disabled" @change="change">经济性</el-checkbox>
              <el-input size="mini" v-model="planForm.jjxqz" placeholder="权重" :disabled="jjxInput" style="width: 60px;"></el-input>
            </el-form-item>
            <el-form-item>
              <el-checkbox class="checkbox" v-model="planForm.hjx" :disabled="disabled" @change="change">环境性</el-checkbox>
              <el-input size="mini" v-model="planForm.hjxqz" placeholder="权重" :disabled="hjxInput" style="width: 60px;"></el-input>
            </el-form-item>
            <el-form-item>
              <el-checkbox class="checkbox" v-model="planForm.nylyl" :disabled="disabled" @change="change">能源利用率</el-checkbox>
              <el-input size="mini" v-model="planForm.nylylqz" placeholder="权重" :disabled="nylylInput" style="width: 60px;"></el-input>
            </el-form-item>
          </el-form>
          <el-button style="float: right;margin-right: 2vh;" type="primary" @click="save">保存</el-button>
        </el-row>

        <el-row style="top: 2vh;width: 99%;height: 80vh;float: left;">
          <div class="board" :style="board">
            <svg ref="svg"></svg>
            <div class="node" v-for="node in nodes" :style="position(node)" @click="handleNode(node)">
              <ul class="tree_ico_list">
                <li><img :src="node.text" style="height: 80%;" /></li>
              </ul>
              <div class="tit">{{ node.title }}</div>
            </div>
          </div>
          <div>
            <el-dialog :title="this.title" :visible.sync="dialogVisible" width="100vh" align="left">
              <!-- 风机弹出框信息 -->
              <el-form v-if="this.title == '风机'" :model="fjform" ref="fjAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌">
                  <el-select v-model="fjform.brand" placeholder="请选择" @change="findFjModelByBrand(fjform.brand)">
                    <el-option v-for="item, index in fjform.brands" :key="index" :value="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号">
                  <el-select v-model="fjform.model" placeholder="请选择" @change="findFjByBrandAndModel(fjform.brand,fjform.model)">
                    <el-option v-for="item, index in fjform.models" :key="index" :value="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh)">
                  <el-input v-model="fjform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh)">
                  <el-input v-model="fjform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年)">
                  <el-input v-model="fjform.life"></el-input>
                </el-form-item>
                <el-form-item label="效率">
                  <el-input v-model="fjform.effic"></el-input>
                </el-form-item>
                <el-form-item label="额定功率(KW)">
                  <el-input v-model="fjform.rated_power"></el-input>
                </el-form-item>
                <el-form-item label="最大功率(KW)">
                  <el-input v-model="fjform.max_power"></el-input>
                </el-form-item>
                <el-form-item label="启动风速(m/s)">
                  <el-input v-model="fjform.start_speed"></el-input>
                </el-form-item>
                <el-form-item label="额定风速(m/s)">
                  <el-input v-model="fjform.rated_speed"></el-input>
                </el-form-item>
                <el-form-item label="安全风速(m/s)">
                  <el-input v-model="fjform.safe_speed"></el-input>
                </el-form-item>
                <el-form-item label="工作温度(℃)">
                  <el-input v-model="fjform.temper"></el-input>
                </el-form-item>
              </el-form>
              <!-- 光伏弹出框信息 -->
              <el-form v-if="this.title == '光伏'" :model="gfform" ref="gfAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌">
                  <el-select v-model="gfform.brand" placeholder="请选择" @change="findGfModelByBrand(gfform.brand)">
                    <el-option v-for="item, index in gfform.brands" :key="index" :value="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号">
                  <el-select v-model="gfform.model" placeholder="请选择" @change="findGfByBrandAndModel(gfform.brand,gfform.model)">
                    <el-option v-for="item, index in gfform.models" :key="index" :value="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh)">
                  <el-input v-model="gfform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh)">
                  <el-input v-model="gfform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年)">
                  <el-input v-model="gfform.life"></el-input>
                </el-form-item>
                <el-form-item label="效率">
                  <el-input v-model="gfform.effic"></el-input>
                </el-form-item>
                <el-form-item label="单位面积功率">
                  <el-input v-model="gfform.unit_area_power"></el-input>
                </el-form-item>
                <el-form-item label="单体容量">
                  <el-input v-model="gfform.single_cap"></el-input>
                </el-form-item>
                <el-form-item label="铭牌">
                  <el-input v-model="gfform.nameplate"></el-input>
                </el-form-item>
              </el-form>
              <!-- 储能弹出框信息 -->
              <el-form v-if="this.title == '储能'" :model="cnform" ref="cnAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌">
                  <el-select v-model="cnform.brand" placeholder="请选择" @change="findCnModelByBrand(cnform.brand)">
                    <el-option v-for="item, index in cnform.brands" :key="index" :value="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号">
                  <el-select v-model="cnform.model" placeholder="请选择" @change="findCnByBrandAndModel(cnform.brand,cnform.model)">
                    <el-option v-for="item, index in cnform.models" :key="index" :value="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh)">
                  <el-input v-model="cnform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh)">
                  <el-input v-model="cnform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年)">
                  <el-input v-model="cnform.life"></el-input>
                </el-form-item>
                <el-form-item label="铭牌">
                  <el-input v-model="cnform.nameplate"></el-input>
                </el-form-item>
                <el-form-item label="额定电压">
                  <el-input v-model="cnform.rated_voltage"></el-input>
                </el-form-item>
                <el-form-item label="内阻">
                  <el-input v-model="cnform.resistance"></el-input>
                </el-form-item>
                <el-form-item label="最大放电电流">
                  <el-input v-model="cnform.max_current"></el-input>
                </el-form-item>
                <el-form-item label="额定功率">
                  <el-input v-model="cnform.rated_power"></el-input>
                </el-form-item>
                <el-form-item label="自放电">
                  <el-input v-model="cnform.discharge"></el-input>
                </el-form-item>
                <el-form-item label="充电电压">
                  <el-input v-model="cnform.charge_voltage"></el-input>
                </el-form-item>
                <el-form-item label="充电电流">
                  <el-input v-model="cnform.charge_current"></el-input>
                </el-form-item>
                <el-form-item label="使用温度">
                  <el-input v-model="cnform.temper"></el-input>
                </el-form-item>
              </el-form>
              <!-- 发电机组弹出框信息 -->
              <el-form v-if="this.title == '发电机组'" :model="fdjzformData" ref="cnAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌:">
                  <el-select v-model="fdjzformData.brand" @change="findFdjzModelByBrand(fdjzformData.brand)">
                    <el-option
                      v-for="value,index in fdjzformData.brands"
                      :key="index"
                      :value="value" >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号:" >
                  <el-select v-model="fdjzformData.model" @change="findFdjzByBrandAndModel(fdjzformData.brand,fdjzformData.model)">
                    <el-option
                      v-for="value,index in fdjzformData.models"
                      :key="index"
                      :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh):" >
                  <el-input v-model="fdjzformData.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh):">
                  <el-input v-model="fdjzformData.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年):">
                  <el-input v-model="fdjzformData.life"></el-input>
                </el-form-item>
                <el-form-item label="效率:">
                  <el-input v-model="fdjzformData.effic"></el-input>
                </el-form-item>
                <el-form-item label="单体容量:">
                  <el-input v-model="fdjzformData.single_cap"></el-input>
                </el-form-item>
                <el-form-item label="热电比:">
                  <el-input v-model="fdjzformData.thermoel"></el-input>
                </el-form-item>
                <el-form-item label="燃料类型:">
                  <el-input v-model="fdjzformData.fuel_type"></el-input>
                </el-form-item>
                <el-form-item label="铭牌:">
                  <el-input v-model="fdjzformData.nameplate"></el-input>
                </el-form-item>
              </el-form>
              <!-- 电锅炉弹出框信息 -->
              <el-form v-if="this.title == '电锅炉'" :model="dglform" ref="dglAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌:">
                  <el-select v-model="dglform.brand" @change="findDglModelByBrand(dglform.brand)">
                    <el-option v-for="value,index in dglform.brands" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号:">
                  <el-select v-model="dglform.model" @change="findDglByBrandAndModel(dglform.brand,dglform.model)">
                    <el-option v-for="value,index in dglform.models" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh):">
                  <el-input v-model="dglform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh):">
                  <el-input v-model="dglform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年):">
                  <el-input v-model="dglform.life"></el-input>
                </el-form-item>
                <el-form-item label="铭牌:">
                  <el-input v-model="dglform.nameplate"></el-input>
                </el-form-item>
                <el-form-item label="额定热功率:">
                  <el-input v-model="dglform.rated_hot_power"></el-input>
                </el-form-item>
                <el-form-item label="额定电功率:">
                  <el-input v-model="dglform.rated_ele_power"></el-input>
                </el-form-item>
                <el-form-item label="供热量:">
                  <el-input v-model="dglform.heat_load"></el-input>
                </el-form-item>
                <el-form-item label="额定电压:">
                  <el-input v-model="dglform.rated_voltage"></el-input>
                </el-form-item>
                <el-form-item label="额定电流:">
                  <el-input v-model="dglform.rated_current"></el-input>
                </el-form-item>
                <el-form-item label="额定出水温度:">
                  <el-input v-model="dglform.rated_cswd"></el-input>
                </el-form-item>
                <el-form-item label="额定回水温度:">
                  <el-input v-model="dglform.rated_hswd"></el-input>
                </el-form-item>
                <el-form-item label="运行总重量:">
                  <el-input v-model="dglform.weight"></el-input>
                </el-form-item>
              </el-form>
              <!-- 冷水机组弹出框信息 -->
              <el-form v-if="this.title == '冷水机组'" :model="lsjzform" ref="lsjzAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌:">
                  <el-select v-model="lsjzform.brand" @change="findLsjzModelByBrand(lsjzform.brand)">
                    <el-option v-for="value,index in lsjzform.brands" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号:">
                  <el-select v-model="lsjzform.model" @change="findLsjzByBrandAndModel(lsjzform.brand,lsjzform.model)">
                    <el-option v-for="value,index in lsjzform.models" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh):">
                  <el-input v-model="lsjzform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh):">
                  <el-input v-model="lsjzform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年):">
                  <el-input v-model="lsjzform.life"></el-input>
                </el-form-item>
                <el-form-item label="铭牌:">
                  <el-input v-model="lsjzform.nameplate"></el-input>
                </el-form-item>
                <el-form-item label="制冷量:">
                  <el-input v-model="lsjzform.refrigera"></el-input>
                </el-form-item>
                <el-form-item label="额定电压:">
                  <el-input v-model="lsjzform.rated_voltage"></el-input>
                </el-form-item>
                <el-form-item label="额定电流:">
                  <el-input v-model="lsjzform.rated_current"></el-input>
                </el-form-item>
                <el-form-item label="最低出水温度:">
                  <el-input v-model="lsjzform.min_cswd"></el-input>
                </el-form-item>
                <el-form-item label="流量:">
                  <el-input v-model="lsjzform.traffic"></el-input>
                </el-form-item>
                <el-form-item label="最高水侧压力:">
                  <el-input v-model="lsjzform.max_pressure"></el-input>
                </el-form-item>
              </el-form>
              <!-- 溴冷机弹出框信息 -->
              <el-form v-if="this.title == '溴冷机'" :model="xljform" ref="xljAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌:">
                  <el-select v-model="xljform.brand" @change="findXljModelByBrand(xljform.brand)">
                    <el-option v-for="value,index in xljform.brands" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号:">
                  <el-select v-model="xljform.model" @change="findXljByBrandAndModel(xljform.brand,xljform.model)">
                    <el-option v-for="value,index in xljform.models" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh):">
                  <el-input v-model="xljform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh):">
                  <el-input v-model="xljform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年):">
                  <el-input v-model="xljform.life"></el-input>
                </el-form-item>
                <el-form-item label="铭牌:">
                  <el-input v-model="xljform.nameplate"></el-input>
                </el-form-item>
                <el-form-item label="制冷cop:">
                  <el-input v-model="xljform.cold_cop"></el-input>
                </el-form-item>
                <el-form-item label="单体容量:">
                  <el-input v-model="xljform.single_cap"></el-input>
                </el-form-item>
              </el-form>
              <!-- 空气热源泵弹出框信息 -->
              <el-form v-if="this.title == '空气热源泵'" :model="kqrbform" ref="kqrbAddForm" label-width="150px"
                label-suffix=":" align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌:">
                  <el-select v-model="kqrbform.brand" @change="findKqyrbModelByBrand(kqrbform.brand)">
                    <el-option v-for="value,index in kqrbform.brands" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号:">
                  <el-select v-model="kqrbform.model" @change="findKqyrbByBrandAndModel(kqrbform.brand,kqrbform.model)">
                    <el-option v-for="value,index in kqrbform.models" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh):">
                  <el-input v-model="kqrbform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh):">
                  <el-input v-model="kqrbform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年):">
                  <el-input v-model="kqrbform.life"></el-input>
                </el-form-item>
                <el-form-item label="铭牌:">
                  <el-input v-model="kqrbform.nameplate"></el-input>
                </el-form-item>
                <el-form-item label="制冷量:">
                  <el-input v-model="kqrbform.refrigera"></el-input>
                </el-form-item>
                <el-form-item label="制热量:">
                  <el-input v-model="kqrbform.heating"></el-input>
                </el-form-item>
                <el-form-item label="额定电压:">
                  <el-input v-model="kqrbform.rated_voltage"></el-input>
                </el-form-item>
                <el-form-item label="额定电流:">
                  <el-input v-model="kqrbform.rated_current"></el-input>
                </el-form-item>
                <el-form-item label="循环水流量:">
                  <el-input v-model="kqrbform.water_traffic"></el-input>
                </el-form-item>
                <el-form-item label="额定水压:">
                  <el-input v-model="kqrbform.rated_water_pressure"></el-input>
                </el-form-item>
                <el-form-item label="进水管尺寸:">
                  <el-input v-model="kqrbform.inlet_pipe_size"></el-input>
                </el-form-item>
              </el-form>
              <!-- 水源热泵弹出框信息 -->
              <el-form v-if="this.title == '水源热泵'" :model="syrbform" ref="syrbAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌:">
                  <el-select v-model="syrbform.brand" @change="findSyrbModelByBrand(syrbform.brand)">
                    <el-option v-for="value,index in syrbform.brands" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号:">
                  <el-select v-model="syrbform.model" @change="findSyrbByBrandAndModel(syrbform.brand,syrbform.model)">
                    <el-option v-for="value,index in syrbform.models" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh):">
                  <el-input v-model="syrbform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh):">
                  <el-input v-model="syrbform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年):">
                  <el-input v-model="syrbform.life"></el-input>
                </el-form-item>
                <el-form-item label="铭牌:">
                  <el-input v-model="syrbform.nameplate"></el-input>
                </el-form-item>
                <el-form-item label="制冷量:">
                  <el-input v-model="syrbform.refrigera"></el-input>
                </el-form-item>
                <el-form-item label="制热量:">
                  <el-input v-model="syrbform.heating"></el-input>
                </el-form-item>
                <el-form-item label="额定电压:">
                  <el-input v-model="syrbform.rated_voltage"></el-input>
                </el-form-item>
                <el-form-item label="额定电流:">
                  <el-input v-model="syrbform.rated_current"></el-input>
                </el-form-item>
                <el-form-item label="额定功率:">
                  <el-input v-model="syrbform.rated_power"></el-input>
                </el-form-item>
              </el-form>
              <!-- 地源热泵弹出框信息 -->
              <el-form v-if="this.title == '地源热泵'" :model="dyrbform" ref="dyrbAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌:">
                  <el-select v-model="dyrbform.brand" @change="findDyrbModelByBrand(dyrbform.brand)">
                    <el-option v-for="value,index in dyrbform.brands" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号:">
                  <el-select v-model="dyrbform.model" @change="findDyrbByBrandAndModel(dyrbform.brand,dyrbform.model)">
                    <el-option v-for="value,index in dyrbform.models" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh):">
                  <el-input v-model="dyrbform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh):">
                  <el-input v-model="dyrbform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年):">
                  <el-input v-model="dyrbform.life"></el-input>
                </el-form-item>
                <el-form-item label="铭牌:">
                  <el-input v-model="dyrbform.nameplate"></el-input>
                </el-form-item>
                <el-form-item label="制冷量:">
                  <el-input v-model="dyrbform.refrigera"></el-input>
                </el-form-item>
                <el-form-item label="制热量:">
                  <el-input v-model="dyrbform.heating"></el-input>
                </el-form-item>
                <el-form-item label="额定电压:">
                  <el-input v-model="dyrbform.rated_voltage"></el-input>
                </el-form-item>
                <el-form-item label="额定电流:">
                  <el-input v-model="dyrbform.rated_current"></el-input>
                </el-form-item>
                <el-form-item label="额定功率:">
                  <el-input v-model="dyrbform.rated_power"></el-input>
                </el-form-item>
              </el-form>
              <!-- 蓄冷弹出框信息 -->
              <el-form v-if="this.title == '蓄冷'" :model="xlform" ref="xlAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌:">
                  <el-select v-model="xlform.brand" @change="findXlModelByBrand(xlform.brand)">
                    <el-option v-for="value,index in xlform.brands" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号:">
                  <el-select v-model="xlform.model" @change="findXlByBrandAndModel(xlform.brand,xlform.model)">
                    <el-option v-for="value,index in xlform.models" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh):">
                  <el-input v-model="xlform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh):">
                  <el-input v-model="xlform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年):">
                  <el-input v-model="xlform.life"></el-input>
                </el-form-item>
                <el-form-item label="铭牌:">
                  <el-input v-model="xlform.nameplate"></el-input>
                </el-form-item>
                <el-form-item label="蓄冷量:">
                  <el-input v-model="xlform.cold_storage"></el-input>
                </el-form-item>
                <el-form-item label="容积:">
                  <el-input v-model="xlform.cap"></el-input>
                </el-form-item>
              </el-form>
              <!-- 蓄热弹出框信息 -->
              <el-form v-if="this.title == '蓄热'" :model="xrform" ref="xrAddForm" label-width="150px" label-suffix=":"
                align="left" style="margin-top: 1.5vh;color: #FFFFFF;" :inline="true">
                <el-form-item label="品牌:">
                  <el-select v-model="xrform.brand" @change="findXrModelByBrand(xrform.brand)">
                    <el-option v-for="value,index in xrform.brands" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="型号:">
                  <el-select v-model="xrform.model" @change="findXrByBrandAndModel(xrform.brand,xrform.model)">
                    <el-option v-for="value,index in xrform.models" :key="index" :value="value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="投资成本(元/kWh):">
                  <el-input v-model="xrform.tz_cost"></el-input>
                </el-form-item>
                <el-form-item label="运维成本(元/kWh):">
                  <el-input v-model="xrform.yw_cost"></el-input>
                </el-form-item>
                <el-form-item label="寿命(年):">
                  <el-input v-model="xrform.life"></el-input>
                </el-form-item>
                <el-form-item label="铭牌:">
                  <el-input v-model="xrform.nameplate"></el-input>
                </el-form-item>
                <el-form-item label="蓄热量:">
                  <el-input v-model="xrform.heat_storage"></el-input>
                </el-form-item>
                <el-form-item label="容积:">
                  <el-input v-model="xrform.cap"></el-input>
                </el-form-item>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="dialogVisible = false">取消</el-button>
                <el-button type="primary" @click="saveDevice">保存</el-button>
              </div>
            </el-dialog>
          </div>
        </el-row>

      </div>

    </div>

  </div>
</template>

<script>
  export default {
    data() {
      return {
        listPlan: [],
        planForm: {
          planName: '',
          target: '',
          intelligence: false,
          jjx: false,
          jjxqz: '',
          hjx: false,
          hjxqz: '',
          nylyl: false,
          nylylqz: ''
        },
        jjxInput: true,
        hjxInput: true,
        nylylInput: true,
        disabled: true,
        project_id: this.$root.project_id,
        plan_id: '',
        rules: {
          planName: [{
            required: true,
            message: '请输入方案名称',
            trigger: 'blur'
          }],
          target: [{
            required: true,
            message: '请选择优化目标',
            trigger: 'change'
          }]
        },
        dialogVisible: false,
        fjform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          rated_power: "", // 额定功率
          max_power: "", // 最大功率
          start_speed: "", // 启动风速
          rated_speed: "", // 额定风速
          safe_speed: "", // 安全风速
          life: "", // 寿命
          effic: "", // 效率
          temper: "", // 工作温度
        },
        gfform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          unit_area_power: "", // 单位面积功率
          life: "", // 寿命
          effic: "", // 效率
          single_cap: "", // 单体容量
          nameplate: "" // 铭牌
        },
        cnform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "",
          yw_cost: "",
          life: "",
          nameplate: "",
          rated_voltage: "",
          resistance: "",
          max_current: "",
          rated_power: "",
          discharge: "",
          charge_voltage: "",
          charge_current: "",
          temper: "",
        },
        fdjzformData: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "",
          yw_cost: "",
          life: "",
          effic: "",
          single_cap: "",
          thermoel: "",
          fuel_type: "",
          nameplate: "",
        },
        dglform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          life: "", // 寿命
          nameplate: "", // 铭牌
          rated_hot_power: "", // 额定热功率
          rated_ele_power: "", // 额定电功率
          heat_load: "", // 供热量
          rated_voltage: "", // 额定电压
          rated_current: "", // 额定电流
          rated_cswd: "", // 额定出水温度
          rated_hswd: "", // 额定回水温度
          weight: "" // 运行总重量
        },
        lsjzform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          life: "", // 寿命
          nameplate: "", // 铭牌
          refrigera: "", // 制冷量
          rated_voltage: "", // 额定电压
          rated_current: "", // 额定电流
          min_cswd: "", // 最低出水温度
          traffic: "", // 流量
          max_pressure: "" // 最高水侧压力
        },
        xljform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          life: "", // 寿命
          nameplate: "", // 铭牌
          cold_cop: "", // 制冷cop
          single_cap: "", // 单体容量
        },
        kqrbform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          life: "", // 寿命
          nameplate: "", // 铭牌
          refrigera: "",
          heating: "",
          rated_voltage: "",
          rated_current: "",
          water_traffic: "",
          rated_water_pressure: "",
          inlet_pipe_size: "",
        },
        syrbform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          life: "", // 寿命
          nameplate: "", // 铭牌
          refrigera: "", // 制冷量
          heating: "", // 制热量
          rated_voltage: "", // 额定电压
          rated_current: "", // 额定电流
          rated_power: "", // 额定功率
        },
        dyrbform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          life: "", // 寿命
          nameplate: "", // 铭牌
          refrigera: "", // 制冷量
          heating: "", // 制热量
          rated_voltage: "", // 额定电压
          rated_current: "", // 额定电流
          rated_power: "", // 额定功率
        },
        xlform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          life: "", // 寿命
          nameplate: "", // 铭牌
          cold_storage: "", // 蓄冷量
          cap: "", // 容积
        },
        xrform: {
          brands: [],
          brand: "",
          models: [],
          model: "",
          tz_cost: "", // 投资成本
          yw_cost: "", // 运维成本
          life: "", // 寿命
          nameplate: "", // 铭牌
          heat_storage: "", // 蓄热量
          cap: "", // 容积
        },
        titles: ['风机', '光伏', '发电机组', '溴冷机', '电锅炉', '冷水机组', '空气热源泵', '水源热泵',
          '地源热泵', '储能', '蓄冷', '蓄热'
        ],
        title: '',
        nodes: [{
          id: 1,
          col: 0,
          row: 0,
          width: 80,
          height: 80,
          left: 20,
          top: 0,
          title: '电网',
          text: "static/img/icon_dw.jpg"
        }, {
          id: 2,
          col: 0,
          row: 1,
          width: 80,
          height: 80,
          left: 20,
          top: 100,
          title: '风机',
          text: "static/img/icon_fj.jpg"
        }, {
          id: 3,
          col: 0,
          row: 2,
          width: 80,
          height: 80,
          left: 20,
          top: 200,
          title: '光伏',
          text: "static/img/icon_gf.jpg"
        }, {
          id: 4,
          col: 0,
          row: 3,
          width: 80,
          height: 80,
          left: 20,
          top: 300,
          title: '储能',
          text: "static/img/cn.jpg"
        }, {
          id: 5,
          col: 0,
          row: 4,
          width: 80,
          height: 80,
          left: 20,
          top: 400,
          title: '发电机组',
          text: "static/img/rdlc.jpg"
        }, {
          id: 6,
          col: 0,
          row: 5,
          width: 80,
          height: 80,
          left: 20,
          top: 500,
          title: '燃气锅炉',
          text: "static/img/rqgl.jpg"
        }, {
          id: 7,
          col: 0,
          row: 6,
          width: 80,
          height: 80,
          left: 20,
          top: 600,
          title: '太阳能热水器',
          text: "static/img/tynrsq.jpg"
        }, {
          id: 8,
          col: 1,
          row: 1,
          width: 80,
          height: 80,
          left: 270,
          top: 70,
          title: '电锅炉',
          text: "static/img/dgl.jpg"
        }, {
          id: 9,
          col: 1,
          row: 2,
          width: 80,
          height: 80,
          left: 370,
          top: 150,
          title: '冷水机组',
          text: "static/img/lsjz.jpg"
        }, {
          id: 10,
          col: 1,
          row: 3,
          width: 80,
          height: 80,
          left: 370,
          top: 250,
          title: '溴冷机',
          text: "static/img/xlj.jpg"
        }, {
          id: 11,
          col: 2,
          row: 1,
          width: 80,
          height: 80,
          left: 470,
          top: 70,
          title: '充电桩',
          text: "static/img/cdz.jpg"
        }, {
          id: 12,
          col: 3,
          row: 1,
          width: 80,
          height: 80,
          left: 670,
          top: 70,
          title: '空气热源泵',
          text: "static/img/kqyrb.jpg"
        }, {
          id: 13,
          col: 3,
          row: 3,
          width: 80,
          height: 80,
          left: 670,
          top: 300,
          title: '冷网',
          text: "static/img/lw.jpg"
        }, {
          id: 14,
          col: 3,
          row: 5,
          width: 80,
          height: 80,
          left: 670,
          top: 500,
          title: '热网',
          text: "static/img/rw.jpg"
        }, {
          id: 15,
          col: 4,
          row: 1,
          width: 80,
          height: 80,
          left: 870,
          top: 70,
          title: '水源热泵',
          text: "static/img/syrb.jpg"
        }, {
          id: 16,
          col: 4,
          row: 3,
          width: 80,
          height: 80,
          left: 870,
          top: 300,
          title: '蓄冷',
          text: "static/img/xl.jpg"
        }, {
          id: 17,
          col: 5,
          row: 1,
          width: 80,
          height: 80,
          left: 1070,
          top: 70,
          title: '地源热泵',
          text: "static/img/dyrb.jpg"
        }, {
          id: 18,
          col: 5,
          row: 5,
          width: 80,
          height: 80,
          left: 1070,
          top: 500,
          title: '蓄热',
          text: "static/img/xr.jpg"
        }, {
          id: 19,
          col: 6,
          row: 0,
          width: 80,
          height: 80,
          left: 1300,
          top: 0,
          title: '电负荷',
          text: "static/img/dfh.jpg"
        }, {
          id: 20,
          col: 6,
          row: 2,
          width: 80,
          height: 80,
          left: 1300,
          top: 200,
          title: '冷负荷',
          text: "static/img/lfh.jpg"
        }, {
          id: 21,
          col: 6,
          row: 4,
          width: 80,
          height: 80,
          left: 1300,
          top: 400,
          title: '热负荷',
          text: "static/img/rfh.jpg"
        }],
        lines: [{
            paths: [
              [100, 40, 1320, 40],
              [100, 140, 200, 140],
              [100, 240, 200, 240],
              [100, 340, 200, 340],
              [100, 440, 200, 440],
              [200, 440, 200, 40],
              [310, 70, 310, 40],
              [510, 70, 510, 40],
              [710, 70, 710, 40],
              [910, 70, 910, 40],
              [1110, 70, 1110, 40]
            ],
            stroke: "#1CFB88",
            strokeWidth: 4
          },
          {
            paths: [
              [100, 540, 410, 540],
              [410, 640, 410, 440],
              [410, 440, 1320, 440],
              [100, 460, 410, 460],
              [710, 500, 710, 440],
              [1110, 500, 1110, 440],
              [670, 110, 650, 110],
              [650, 110, 650, 440],
              [870, 110, 850, 110],
              [850, 110, 850, 440],
              [1070, 110, 1050, 110],
              [1050, 110, 1050, 440],
              [100, 640, 410, 640]
            ],
            stroke: "#ECC951",
            strokeWidth: 4
          },
          {
            paths: [
              [450, 190, 610, 190],
              [450, 290, 610, 290],
              [610, 190, 610, 290],
              [610, 240, 1320, 240],
              [710, 300, 710, 240],
              [910, 300, 910, 240],
              [750, 110, 810, 110],
              [810, 110, 810, 240],
              [950, 110, 1010, 110],
              [1010, 110, 1010, 240],
              [1150, 110, 1210, 110],
              [1210, 110, 1210, 240],
            ],
            stroke: "#ff00ff",
            strokeWidth: 4
          }
        ]
      }
    },
    created() {
      this.findfj();
      this.findgf();
      this.finddgl();
      this.findxlj();
      this.findlsjz();
      this.findkqyrb();
      this.findsyrb();
      this.finddyrb();
      this.findcn();
      this.findxl();
      this.findxr();
      this.findfdjz();
    },
    mounted() {
      this.getPlan();

      var paper = Snap(this.$refs.svg);
      R.forEach(line => {
        const paths = line.paths
        const stroke = line.stroke
        const strokeWidth = line.strokeWidth
        R.forEach(([x1, y1, x2, y2]) => {
          const line = paper.line(x1, y1, x2, y2)
          line.attr({
            stroke: stroke,
            strokeWidth: strokeWidth
          })
        }, paths)
      }, this.lines)
    },
    computed: {
      board() {
        const rows = R.reduce((rows, node) => R.max(rows, node.row), 0, this.nodes) + 1
        return {
          height: rows * 100 + 'px'
        }
      }
    },
    methods: {
      save() {
        this.$refs['planForm'].validate((valid) => {
          if (valid) {
            this.$http.post('/iepsapi/planProgram/savePlan', {
              plan_id: this.plan_id,
              project_id: this.project_id,
              plan_name: this.planForm.planName,
              target: this.planForm.target,
              intelligence: this.planForm.intelligence,
              targetForm: [{
                  target_name: '经济性',
                  is_choose: this.planForm.jjx,
                  weight: this.planForm.jjxqz
                },
                {
                  target_name: '环境性',
                  is_choose: this.planForm.hjx,
                  weight: this.planForm.hjxqz
                },
                {
                  target_name: '能源利用率',
                  is_choose: this.planForm.nylyl,
                  weight: this.planForm.nylylqz
                }
              ]
            }).then((res) => {
              if (res.data.flag) {
                this.$message({
                  type: 'success',
                  message: res.data.message
                });
              } else {
                this.$message.error(res.data.message);
              }
              this.getPlan();
              this.creat()
            }).catch((error) => {
              console.log(error);
            });
          }
        });
      },
      getPlan() {
        this.$http.post('/iepsapi/planProgram/getPlan', {
          project_id: this.project_id
        }).then((res) => {
          this.listPlan = res.data.data;
        }).catch((error) => {
          console.log(error);
        });
      },
      deletePlan() {
        if (this.plan_id == "") {
          this.$message.error("请先选择方案!")
          return;
        }
        this.$http.post('/iepsapi/planProgram/deletePlan', {
          plan_id: this.plan_id
        }).then((res) => {
          if (res.data.flag) {
            this.$message({
              type: 'success',
              message: res.data.message
            });
          } else {
            this.$message.error(res.data.message);
          }
          this.getPlan();
          this.creat()
        }).catch((error) => {
          console.log(error);
        });
      },
      creat() {
        this.$refs["planForm"].resetFields();
        this.plan_id = "";
        this.planForm.jjx = false;
        this.planForm.jjxqz = "";
        this.planForm.hjx = false;
        this.planForm.hjxqz = "";
        this.planForm.nylyl = false;
        this.planForm.nylylqz = "";
        this.disabled = true;
        this.planForm.intelligence = false
      },
      currentChange(row) {
        this.plan_id = row.plan_id;
        this.planForm.planName = row.plan_name
        this.planForm.target = row.target
        this.planForm.intelligence = row.intelligence == "true" ? true : false
        this.disabled = row.target == '综合最优' ? false : true;
        this.planForm.jjx = row.jjx
        this.planForm.hjx = row.hjx
        this.planForm.nylyl = row.nylyl
      },
      change() {
        this.disabled = this.planForm.target == '综合最优' ? false : true;
        this.jjxInput = !this.planForm.jjx;
        this.hjxInput = !this.planForm.hjx;
        this.nylylInput = !this.planForm.nylyl;
      },
      position(item) {
        return {
          left: item.left + 'px',
          top: item.top + 'px',
          width: item.width + 'px',
          height: item.height + 'px'
        }
      },
      handleNode(node) {
        var arr = this.titles;
        for (var i = 0; i < arr.length; i++) {
          if (arr[i] == node.title) {
            this.title = arr[i];
            this.dialogVisible = true
          }
        }
      },
      // 保存设备信息
      saveDevice() {
        if (this.plan_id == "") {
          this.$message.error("请先选择方案!")
          this.dialogVisible = false
          return;
        }
        var name = this.title
        var device_brand = ""
        var device_model = ""
        if ("风机" == name) {
          device_brand = this.fjform.brand
          device_model = this.fjform.model
        } else if ("光伏" == name) {
          device_brand = this.gfform.brand
          device_model = this.gfform.model
        } else if ("储能" == name) {
          device_brand = this.cnform.brand
          device_model = this.cnform.model
        } else if ("发电机组" == name) {
          device_brand = this.fdjzformData.brand
          device_model = this.fdjzformData.model
        } else if ("电锅炉" == name) {
          device_brand = this.dglform.brand
          device_model = this.dglform.model
        } else if ("冷水机组" == name) {
          device_brand = this.lsjzform.brand
          device_model = this.lsjzform.model
        } else if ("溴冷机" == name) {
          device_brand = this.xljform.brand
          device_model = this.xljform.model
        } else if ("空气热源泵" == name) {
          device_brand = this.kqrbform.brand
          device_model = this.kqrbform.model
        } else if ("水源热泵" == name) {
          device_brand = this.syrbform.brand
          device_model = this.syrbform.model
        } else if ("地源热泵" == name) {
          device_brand = this.dyrbform.brand
          device_model = this.dyrbform.model
        } else if ("蓄冷" == name) {
          device_brand = this.xlform.brand
          device_model = this.xlform.model
        } else if ("蓄热" == name) {
          device_brand = this.xrform.brand
          device_model = this.xrform.model
        }

        this.$http.post('/iepsapi/planProgram/saveDevice', {
          plan_id: this.plan_id,
          device_name: this.title,
          device_type: this.title,
          device_brand: device_brand,
          device_model: device_model
        }).then((res) => {
          if (res.data.flag) {
            this.$message({
              type: 'success',
              message: res.data.message
            });
          } else {
            this.$message.error(res.data.message);
          }
        }).catch((error) => {
          console.log(error);
        });
      },
      //查询所有风机设备信息
      findfj() {
        this.$http.post("/iepsapi/dispatch/findAllFj").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.fjform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有光伏设备信息
      findgf() {
        this.$http.post("/iepsapi/dispatch/findAllGf").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.gfform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有电锅炉设备信息
      finddgl() {
        this.$http.post("/iepsapi/dispatch/findAllDgl").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.dglform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有溴冷机设备信息
      findxlj() {
        this.$http.post("/iepsapi/dispatch/findAllXlj").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.xljform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有冷水机组设备信息
      findlsjz() {
        this.$http.post("/iepsapi/dispatch/findAllLsjz").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.lsjzform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有空气源热泵设备信息
      findkqyrb() {
        this.$http.post("/iepsapi/dispatch/findAllKqyrb").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.kqrbform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有水源热泵设备信息
      findsyrb() {
        this.$http.post("/iepsapi/dispatch/findAllSyrb").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.syrbform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有地源热泵设备信息
      finddyrb() {
        this.$http.post("/iepsapi/dispatch/findAllDyrb").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.dyrbform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有储能设备信息
      findcn() {
        this.$http.post("/iepsapi/dispatch/findAllCn").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.cnform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有蓄冷设备信息
      findxl() {
        this.$http.post("/iepsapi/dispatch/findAllXl").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.xlform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有蓄热设备信息
      findxr() {
        this.$http.post("/iepsapi/dispatch/findAllXr").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.xrform.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //查询所有发电机组设备信息
      findfdjz() {
        this.$http.post("/iepsapi/dispatch/findAllFdjz").then((res) => {
          if (res.data.flag) {
            //进行回显
            this.fdjzformData.brands = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },

      //根据风机品牌查询型号
      findFjModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findFjModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //清空
            this.fjform.model = ""
            this.fjform.tz_cost = "";
            this.fjform.yw_cost = "";
            this.fjform.rated_power = "";
            this.fjform.max_power = "";
            this.fjform.start_speed = "";
            this.fjform.life = "";
            this.fjform.rated_speed = "";
            this.fjform.safe_speed = "";
            this.fjform.effic = "";
            this.fjform.temper = "";
            //进行回显
            this.fjform.models = res.data.data
          }
        });
      },
      //根据光伏品牌查询型号
      findGfModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findGfModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //清空
            this.gfform.model = ""
            this.gfform.tz_cost = "";
            this.gfform.yw_cost = "";
            this.gfform.unit_area_power = "";
            this.gfform.life = "";
            this.gfform.effic = "";
            this.gfform.single_cap = "";
            this.gfform.nameplate = "";
            //进行回显
            this.gfform.models = res.data.data
          }
        });
      },
      //根据电锅炉品牌查询型号
      findDglModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findDglModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //清空
            this.dglform.model = ""
            this.dglform.tz_cost = "";
            this.dglform.yw_cost = "";
            this.dglform.life = "";
            this.dglform.nameplate = "";
            this.dglform.rated_hot_power = "";
            this.dglform.rated_ele_power = "";
            this.dglform.heat_load = "";
            this.dglform.rated_voltage = "";
            this.dglform.rated_current = "";
            this.dglform.rated_cswd = "";
            this.dglform.rated_hswd = "";
            this.dglform.weight = "";
            //进行回显
            this.dglform.models = res.data.data
          }
        });
      },
      //根据溴冷机品牌查询型号
      findXljModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findXljModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //清空
            this.xljform.model = ""
            this.xljform.tz_cost = "";
            this.xljform.yw_cost = "";
            this.xljform.life = "";
            this.xljform.single_cap = "";
            this.xljform.cold_cop = "";
            this.xljform.nameplate = "";
            //进行回显
            this.xljform.models = res.data.data
          }
        });
      },
      //根据冷水机组品牌查询型号
      findLsjzModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findLsjzModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.lsjzform.model = ""
            this.lsjzform.models = res.data.data
            this.lsjzform.tz_cost = "";
            this.lsjzform.yw_cost = "";
            this.lsjzform.life = "";
            this.lsjzform.nameplate = "";
            this.lsjzform.refrigera = "";
            this.lsjzform.rated_voltage = "";
            this.lsjzform.rated_current = "";
            this.lsjzform.min_cswd = "";
            this.lsjzform.traffic = "";
            this.lsjzform.max_pressure = "";
          }
        });
      },
      //根据空气源热泵品牌查询型号
      findKqyrbModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findKqyrbModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.kqrbform.model = ""
            this.kqrbform.models = res.data.data
            this.kqrbform.tz_cost = "";
            this.kqrbform.yw_cost = "";
            this.kqrbform.life = "";
            this.kqrbform.nameplate = "";
            this.kqrbform.refrigera = "";
            this.kqrbform.heating = "";
            this.kqrbform.rated_voltage = "";
            this.kqrbform.rated_current = "";
            this.kqrbform.water_traffic = "";
            this.kqrbform.rated_water_pressure = "";
            this.kqrbform.inlet_pipe_size = "";
          }
        });
      },
      //根据水源热泵品牌查询型号
      findSyrbModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findSyrbModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.syrbform.model = ""
            this.syrbform.models = res.data.data
            this.syrbform.tz_cost = "";
            this.syrbform.yw_cost = "";
            this.syrbform.life = "";
            this.syrbform.nameplate = "";
            this.syrbform.refrigera = "";
            this.syrbform.heating = "";
            this.syrbform.rated_voltage = "";
            this.syrbform.rated_current = "";
            this.syrbform.rated_power = "";
          }
        });
      },
      //根据地源热泵品牌查询型号
      findDyrbModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findDyrbModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.dyrbform.model = ""
            this.dyrbform.models = res.data.data
            this.dyrbform.tz_cost = "";
            this.dyrbform.yw_cost = "";
            this.dyrbform.life = "";
            this.dyrbform.nameplate = "";
            this.dyrbform.refrigera = "";
            this.dyrbform.heating = "";
            this.dyrbform.rated_voltage = "";
            this.dyrbform.rated_current = "";
            this.dyrbform.rated_power = "";
          }
        });
      },
      //根据储能品牌查询型号
      findCnModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findCnModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.cnform.model = ""
            this.cnform.models = res.data.data
            this.cnform.tz_cost = "";
            this.cnform.yw_cost = "";
            this.cnform.life = "";
            this.cnform.nameplate = "";
            this.cnform.rated_voltage = "";
            this.cnform.resistance = "";
            this.cnform.max_current = "";
            this.cnform.rated_power = "";
            this.cnform.discharge = "";
            this.cnform.charge_voltage = "";
            this.cnform.charge_current = "";
            this.cnform.temper = "";
          }
        });
      },
      //根据蓄冷品牌查询型号
      findXlModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findXlModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.xlform.model = ""
            this.xlform.models = res.data.data
            this.xlform.tz_cost = "";
            this.xlform.yw_cost = "";
            this.xlform.life = "";
            this.xlform.nameplate = "";
            this.xlform.cold_storage = "";
            this.xlform.cap = "";
          }
        });
      },
      //根据蓄热品牌查询型号
      findXrModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findXrModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.xrform.model = ""
            this.xrform.models = res.data.data
            this.xrform.tz_cost = "";
            this.xrform.yw_cost = "";
            this.xrform.life = "";
            this.xrform.nameplate = "";
            this.xrform.heat_storage = "";
            this.xrform.cap = "";
          }
        });
      },
      //根据发电机组品牌查询型号
      findFdjzModelByBrand(brand) {
        this.$http.post("/iepsapi/dispatch/findFdjzModelByBrand?brand=" + brand).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.fdjzformData.model = ""
            this.fdjzformData.models = res.data.data
            this.fdjzformData.tz_cost = "";
            this.fdjzformData.yw_cost = "";
            this.fdjzformData.life = "";
            this.fdjzformData.effic = "";
            this.fdjzformData.single_cap = "";
            this.fdjzformData.thermoel = "";
            this.fdjzformData.fuel_type = "";
            this.fdjzformData.nameplate = "";
          }
        });
      },

      //根据风机品牌和型号查询设备信息
      findFjByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByFjBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.fjform.tz_cost = res.data.data.tz_cost;
            this.fjform.yw_cost = res.data.data.yw_cost;
            this.fjform.rated_power = res.data.data.rated_power;
            this.fjform.max_power = res.data.data.max_power;
            this.fjform.start_speed = res.data.data.start_speed;
            this.fjform.life = res.data.data.life;
            this.fjform.rated_speed = res.data.data.rated_speed;
            this.fjform.safe_speed = res.data.data.safe_speed;
            this.fjform.effic = res.data.data.effic;
            this.fjform.temper = res.data.data.temper;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据光伏品牌和型号查询设备信息
      findGfByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByGfBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.gfform.tz_cost = res.data.data.tz_cost;
            this.gfform.yw_cost = res.data.data.yw_cost;
            this.gfform.unit_area_power = res.data.data.unit_area_power;
            this.gfform.life = res.data.data.life;
            this.gfform.effic = res.data.data.effic;
            this.gfform.single_cap = res.data.data.single_cap;
            this.gfform.nameplate = res.data.data.nameplate;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据电锅炉品牌和型号查询设备信息
      findDglByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByDglBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.dglform.tz_cost = res.data.data.tz_cost;
            this.dglform.yw_cost = res.data.data.yw_cost;
            this.dglform.life = res.data.data.life;
            this.dglform.nameplate = res.data.data.nameplate;
            this.dglform.rated_hot_power = res.data.data.rated_hot_power;
            this.dglform.rated_ele_power = res.data.data.rated_ele_power;
            this.dglform.heat_load = res.data.data.heat_load;
            this.dglform.rated_voltage = res.data.data.rated_voltage;
            this.dglform.rated_current = res.data.data.rated_current;
            this.dglform.rated_cswd = res.data.data.rated_cswd;
            this.dglform.rated_hswd = res.data.data.rated_hswd;
            this.dglform.weight = res.data.data.weight;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据溴冷机品牌和型号查询设备信息
      findXljByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByXljBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.xljform.tz_cost = res.data.data.tz_cost;
            this.xljform.yw_cost = res.data.data.yw_cost;
            this.xljform.life = res.data.data.life;
            this.xljform.single_cap = res.data.data.single_cap;
            this.xljform.cold_cop = res.data.data.cold_cop;
            this.xljform.nameplate = res.data.data.nameplate;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据冷水机组品牌和型号查询设备信息
      findLsjzByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByLsjzBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.lsjzform.tz_cost = res.data.data.tz_cost;
            this.lsjzform.yw_cost = res.data.data.yw_cost;
            this.lsjzform.life = res.data.data.life;
            this.lsjzform.nameplate = res.data.data.nameplate;
            this.lsjzform.refrigera = res.data.data.refrigera;
            this.lsjzform.rated_voltage = res.data.data.rated_voltage;
            this.lsjzform.rated_current = res.data.data.rated_current;
            this.lsjzform.min_cswd = res.data.data.min_cswd;
            this.lsjzform.traffic = res.data.data.traffic;
            this.lsjzform.max_pressure = res.data.data.max_pressure;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据空气源热泵品牌和型号查询设备信息
      findKqyrbByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByKqyrbBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.kqrbform.tz_cost = res.data.data.tz_cost;
            this.kqrbform.yw_cost = res.data.data.yw_cost;
            this.kqrbform.life = res.data.data.life;
            this.kqrbform.nameplate = res.data.data.nameplate;
            this.kqrbform.refrigera = res.data.data.refrigera;
            this.kqrbform.heating = res.data.data.heating;
            this.kqrbform.rated_voltage = res.data.data.rated_voltage;
            this.kqrbform.rated_current = res.data.data.rated_current;
            this.kqrbform.water_traffic = res.data.data.water_traffic;
            this.kqrbform.rated_water_pressure = res.data.data.rated_water_pressure;
            this.kqrbform.inlet_pipe_size = res.data.data.inlet_pipe_size;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据水源热泵品牌和型号查询设备信息
      findSyrbByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findBySyrbBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.syrbform.tz_cost = res.data.data.tz_cost;
            this.syrbform.yw_cost = res.data.data.yw_cost;
            this.syrbform.life = res.data.data.life;
            this.syrbform.nameplate = res.data.data.nameplate;
            this.syrbform.refrigera = res.data.data.refrigera;
            this.syrbform.heating = res.data.data.heating;
            this.syrbform.rated_voltage = res.data.data.rated_voltage;
            this.syrbform.rated_current = res.data.data.rated_current;
            this.syrbform.rated_power = res.data.data.rated_power;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据地源热泵品牌和型号查询设备信息
      findDyrbByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByDyrbBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.dyrbform.tz_cost = res.data.data.tz_cost;
            this.dyrbform.yw_cost = res.data.data.yw_cost;
            this.dyrbform.life = res.data.data.life;
            this.dyrbform.nameplate = res.data.data.nameplate;
            this.dyrbform.refrigera = res.data.data.refrigera;
            this.dyrbform.heating = res.data.data.heating;
            this.dyrbform.rated_voltage = res.data.data.rated_voltage;
            this.dyrbform.rated_current = res.data.data.rated_current;
            this.dyrbform.rated_power = res.data.data.rated_power;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据储能品牌和型号查询设备信息
      findCnByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByCnBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.cnform.tz_cost = res.data.data.tz_cost;
            this.cnform.yw_cost = res.data.data.yw_cost;
            this.cnform.life = res.data.data.life;
            this.cnform.nameplate = res.data.data.nameplate;
            this.cnform.rated_voltage = res.data.data.rated_voltage;
            this.cnform.resistance = res.data.data.resistance;
            this.cnform.max_current = res.data.data.max_current;
            this.cnform.rated_power = res.data.data.rated_power;
            this.cnform.discharge = res.data.data.discharge;
            this.cnform.charge_voltage = res.data.data.charge_voltage;
            this.cnform.charge_current = res.data.data.charge_current;
            this.cnform.temper = res.data.data.temper;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据蓄冷品牌和型号查询设备信息
      findXlByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByXlBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.xlform.tz_cost = res.data.data.tz_cost;
            this.xlform.yw_cost = res.data.data.yw_cost;
            this.xlform.life = res.data.data.life;
            this.xlform.nameplate = res.data.data.nameplate;
            this.xlform.cold_storage = res.data.data.cold_storage;
            this.xlform.cap = res.data.data.cap;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据蓄热品牌和型号查询设备信息
      findXrByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByXrBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.xrform.tz_cost = res.data.data.tz_cost;
            this.xrform.yw_cost = res.data.data.yw_cost;
            this.xrform.life = res.data.data.life;
            this.xrform.nameplate = res.data.data.nameplate;
            this.xrform.heat_storage = res.data.data.heat_storage;
            this.xrform.cap = res.data.data.cap;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      //根据发电机组品牌和型号查询设备信息
      findFdjzByBrandAndModel(brand, model) {
        this.$http.post("/iepsapi/dispatch/findByFdjzBrand?brand=" + brand + "&model=" + model).then((res) => {
          if (res.data.flag) {
            //进行回显
            this.fdjzformData.tz_cost = res.data.data.tz_cost;
            this.fdjzformData.yw_cost = res.data.data.yw_cost;
            this.fdjzformData.life = res.data.data.life;
            this.fdjzformData.effic = res.data.data.effic;
            this.fdjzformData.single_cap = res.data.data.single_cap;
            this.fdjzformData.thermoel = res.data.data.thermoel;
            this.fdjzformData.fuel_type = res.data.data.fuel_type;
            this.fdjzformData.nameplate = res.data.data.nameplate;
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
    }
  }
</script>

<style scoped>
  @import './style/tree.css';

  .box1 {
    position: relative;
    width: 14%;
    background: inherit;
    background-color: rgba(45, 61, 136, 0.6);
    color: white;
    height: 89vh;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(226, 239, 249, 1);
    border: none;
    border-radius: 5px;
    -webkit-box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.345098039215686);
    box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.345098039215686);
    font-size: 2vh;
    text-align: right;
    display: inline-block;
    float: left;
    top: 1vh;
  }

  .box2 {
    position: relative;
    width: 85%;
    height: 89vh;
    margin-top: 0.5%;
    margin-left: 0.5%;
    background: inherit;
    background-color: rgba(45, 61, 136, 0.6);
    color: white;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(226, 239, 249, 1);
    border: none;
    border-radius: 5px;
    -webkit-box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.345098039215686);
    box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.345098039215686);
    font-size: 2vh;
    text-align: right;
    display: inline-block;
    float: right;
  }

  /deep/ .el-dialog {
    background: rgba(40, 54, 121, 0.9);
    -webkit-box-sizing: border-box;
    border: none;

  }

  /deep/ .el-dialog__header {
    padding: 20px 20px 10px;
    color: #FFF;
    background: #374590;
  }

  /deep/ .el-dialog__title {
    line-height: 15px;
    font-size: 16px;
    color: #FFF;
  }

  /deep/ .el-form-item__label {
    text-align: right;
    vertical-align: middle;
    float: left;
    font-size: 14px;
    color: #FFF !important;
    line-height: 40px;
    padding: 0 12px 0 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
  }

  /deep/ .el-input.is-disabled .el-input__inner {
    background-color: #161E43;
    border-color: #161E43;
    color: #FFFFFF;
    text-align: left;
    cursor: not-allowed;
  }

  /deep/ .el-input__inner {
    -webkit-appearance: none;
    background-color: #161E43;
    background-image: none;
    border-radius: 4px;
    border: 1px solid #161E43;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    color: #FFFFFF;
    display: inline-block;
    font-size: inherit;
    height: 40px;
    line-height: 40px;
    outline: 0;
    padding: 0 15px;
    -webkit-transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
    transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
    width: 100%;
  }
</style>
